<template>
	<view>
		<view class="cell-group">
			<view class="nut-cell">
				<view class="cell-title">
					<span>版本 </span>
				</view>
				<view>v.{{ appVersion }}</view>
			</view>
		</view>
		<view class="btn">
			<uv-button text="退出登录" @click="unlogin" :loading="loading" shape="circle"
				:color="app.globalData.primaryColor"></uv-button>
		</view>
	</view>
</template>

<script setup>
	import {
		ref,
	} from 'vue'
	const {
		appVersion
	} = uni.getSystemInfoSync()
	const loading = ref(false)
	const app = getApp()
	const unlogin = () => {
		loading.value = true
		uni.clearStorageSync()
		setTimeout(() => {
			loading.value = false
			uni.switchTab({
				url: '/pages/index/index'
			})
		}, 1000);
	}
</script>

<style lang="scss" scoped>
	.cell-group {
		display: inherit;
		margin: 10px;
		overflow: hidden;
		background-color: #fff;
		border-radius: 6px;
		box-shadow: 0 1px 7px 0 rgb(237, 238, 241);

		.nut-cell {
			display: flex;
			box-shadow: none;
			padding: 10px;
			width: -webkit-fill-available;

			&:active {
				background-color: #d9d9d9;
			}

			.cell-title {
				width: 100%;
				font-size: 14px;
				line-height: 20px;
				color: #666;
			}
		}
	}
</style>